unsigned int opt_ne_base = 0; /* NE2k NICs cannot be probed */
unsigned char opt_ifname[10] = "eth0";
int opt_noht=0, opt_noacpi=0, opt_nosmp=0;
-int opt_phys_bootmac=0; /* Is DOM0/VIF0 allocated the physical MAC address? */
enum { OPT_IP, OPT_STR, OPT_UINT, OPT_BOOL };
static struct {
unsigned char *name;
int type;
void *var;
} opts[] = {
- { "console", OPT_UINT, &opt_console },
- { "ser_baud", OPT_UINT, &opt_ser_baud },
- { "dom0_mem", OPT_UINT, &opt_dom0_mem },
- { "ne_base", OPT_UINT, &opt_ne_base },
- { "ifname", OPT_STR, &opt_ifname },
- { "noht", OPT_BOOL, &opt_noht },
- { "noacpi", OPT_BOOL, &opt_noacpi },
- { "nosmp", OPT_BOOL, &opt_nosmp },
- { "phys_bootmac", OPT_BOOL, &opt_phys_bootmac },
+ { "console", OPT_UINT, &opt_console },
+ { "ser_baud", OPT_UINT, &opt_ser_baud },
+ { "dom0_mem", OPT_UINT, &opt_dom0_mem },
+ { "ne_base", OPT_UINT, &opt_ne_base },
+ { "ifname", OPT_STR, &opt_ifname },
+ { "noht", OPT_BOOL, &opt_noht },
+ { "noacpi", OPT_BOOL, &opt_noacpi },
+ { "nosmp", OPT_BOOL, &opt_nosmp },
{ NULL, 0, NULL }
};
net_ring_t *new_ring = NULL;
struct task_struct *p = NULL;
unsigned long flags, vmac_hash;
- unsigned char vmac_key[ETH_ALEN + 4 + 2];
- extern int opt_phys_bootmac;
+ unsigned char vmac_key[ETH_ALEN + 2 + MAX_DOMAIN_NAME];
if ( !(p = find_domain_by_id(domain)) )
return NULL;
spin_lock_init(&new_vif->rx_lock);
spin_lock_init(&new_vif->tx_lock);
- if ( opt_phys_bootmac && (p->domain == 0) && (dom_vif_idx == 0) )
+ if ( (p->domain == 0) && (dom_vif_idx == 0) )
{
/*
- * DOM0/VIF0 may get the real physical MAC address, so that
- * users can easily get a Xenoserver up and running by using an
- * existing DHCP entry.
+ * DOM0/VIF0 gets the real physical MAC address, so that users can
+ * easily get a Xenoserver up and running by using an existing DHCP
+ * entry.
*/
memcpy(new_vif->vmac, the_dev->dev_addr, ETH_ALEN);
}
/*
* Most VIFs get a random MAC address with a "special" vendor id.
* We try to get MAC addresses to be unique across multiple servers
- * by including the physical MAC address in the hash.
- * However, the same machine with the same dom_id and vif_id should
- * always get the same virtual MAC address.
+ * by including the physical MAC address in the hash. The hash also
+ * includes the vif index and the domain's name.
*
* NB. The vendor is currently an "obsolete" one that used to belong
* to DEC (AA-00-00). Using it is probably a bit rude :-)
* MAC addresses for some VIFs with no fear of clashes.
*/
memcpy(&vmac_key[0], the_dev->dev_addr, ETH_ALEN);
- *(__u32 *)(&vmac_key[ETH_ALEN+0]) = htonl(p->domain);
- *(__u16 *)(&vmac_key[ETH_ALEN+4]) = htons(dom_vif_idx);
- vmac_hash = hash(vmac_key, ETH_ALEN+4+2);
+ *(__u16 *)(&vmac_key[ETH_ALEN]) = htons(dom_vif_idx);
+ strcpy(&vmac_key[ETH_ALEN+2], p->name);
+ vmac_hash = hash(vmac_key, ETH_ALEN + 2 + strlen(p->name));
memcpy(new_vif->vmac, "\xaa\x00\x00", 3);
new_vif->vmac[3] = (vmac_hash >> 16) & 0xef; /* First bit is zero. */
new_vif->vmac[4] = (vmac_hash >> 8) & 0xff;